package com.otitan.la.forest.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * 日志表
 *
 * @author jiacs
 * @email xxx
 * @date 2020-10-09 09:52:17
 */
@Data
@TableName("\"SYS_LOG\"")
@ApiModel("日志表实体")
public class LogEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
    * 主键
    */
    @ApiModelProperty(value = "主键", required = true)
    @TableId("\"ID\"")
    private String id;

    /**
    * 应用编码
    */
    @ApiModelProperty(value = "应用编码", required = true)
     @NotEmpty(message = "应用编码不能为空")
     @Length(max = 32, message = "应用编码不能超过 32 个字符")
    @TableField("\"APP_CODE\"")
    private String appCode;

    /**
    * 菜单编码
    */
    @ApiModelProperty(value = "菜单编码", required = true)
     @NotEmpty(message = "菜单编码不能为空")
     @Length(max = 64, message = "菜单编码不能超过 64 个字符")
    @TableField("\"MENU_CODE\"")
    private String menuCode;

    /**
    * 操作
    */
    @ApiModelProperty(value = "操作", required = true)
     @NotEmpty(message = "操作不能为空")
     @Length(max = 12, message = "操作不能超过 12 个字符")
    @TableField("\"ACTION\"")
    private String action;

    /**
    * 账号
    */
    @ApiModelProperty(value = "账号", required = false)
    @TableField("\"USER_NAME\"")
    private String userName;

    /**
    * 真实姓名
    */
    @ApiModelProperty(value = "真实姓名", required = false)
    @TableField("\"REAL_NAME\"")
    private String realName;

    /**
    * IP地址
    */
    @ApiModelProperty(value = "IP地址", required = false)
    @TableField("\"IP\"")
    private String ip;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID", required = false)
    @TableField("\"USER_ID\"")
    private String userId;

    /**
    * 是否删除
    */
    @ApiModelProperty(value = "是否删除", required = false)
    @TableField(value = "\"IS_DELETE\"", fill = FieldFill.INSERT)
    @TableLogic  //逻辑删除注解
    @JsonIgnore  //忽略
    private Integer isDelete;

    /**
    * 创建用户
    */
    @ApiModelProperty(value = "创建用户", required = false)
    @TableField(value = "\"CREATE_USER\"", fill = FieldFill.INSERT)
    private String createUser;

    /**
    * 创建时间
    */
    @ApiModelProperty(value = "创建时间", required = false)
    @TableField(value = "\"CREATE_DATE\"", fill = FieldFill.INSERT)
    private Date createDate;

}
